/******************************************************************************/
/* File: udpTrafficRecver.h                                                   */
/******************************************************************************/

#ifndef UDPTRAFFICRECVER_H
#define UDPTRAFFICRECVER_H

#include <sys/types.h>
#include "thread.h"
#include "socketClass.h"
#include "dataStore.h"
#include "utilClass.h"

class UDPTrafficRecver : public Thread {

public:
    UDPTrafficRecver(UDPConnectedSocket *pus, ThreadConf *ptc);
    ~UDPTrafficRecver();

    int RecvPacket(int64_t *packetID, int length, timeval *sentTime);
    
    void UploadReport(double begin, double end, int64_t transfer, double bandwidth, 
                      int64_t totalPackets, double jitter, int64_t lostPackets);

    void ExitCleanUp();
    virtual void Run();
    
protected:
    UDPConnectedSocket *pUdpSock;
    ThreadConf *pThreadConf;
    
    char *pRecvBuf;
};

#endif

/******************************************************************************/
/* End File: udpTrafficRecver.h                                               */
/******************************************************************************/